-- Hypercard automatically creates a new file when you
-- issue the "open" command. So we read from the file
-- to see if there is anything in it.
-- Be sure to delete any excess files created by this.
-- You can probably type in a path name to a file, if it is not
-- in the same folder as HyperCard
global inFile
global error
open file inFile
read from file inFile until return
if it is empty then
put "That file does not exist"
put "true" into error
exit goodFile
end if
close file inFile
end goodFile
on newField fieldName
put the number of background fields into numFields
put numFields + 1 into thisField
put "click where you want the field to go"
wait until the mouseClick
put the mouseLoc into here
domenu "new field"
put first item of here into right
add 150 to right
put second item of here into bottom
add 20 to bottom
put here && ","&& right && "," && bottom into thePlace
set rect of background field thisField to thePlace
set style of background field thisField to rectangle
set name of background field thisField to fieldName
end newField
-- part 79 (button)
-- low flags: 00
-- high flags: 8000
-- rect: left=407 top=25 right=83 bottom=479
-- title width / last selected line: 0
-- icon id / first selected line: 14767 / 14767
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: About...
----- HyperTalk script -----
on mouseUp
show card field "about"
end mouseUp
-- part 81 (field)
-- low flags: 01
-- high flags: 0004
-- rect: left=0 top=20 right=342 bottom=512
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: about
----- HyperTalk script -----
on mouseUp
hide card field "about"
end mouseUp
-- part contents for card part 5
----- text -----
1 Frederik Pohl Heechee Rendezvous Ballantine pb 83 320 3.95 4 fic sf 3/22/85 Might round out the Heechee saga that started in Gateway. Read it on the plane to NYC. Pohl is, of course, one of the very best. Still, this novel did not move me like it should have, like Gateway did. It tells a larger story than Gateway -- that is, it is not primarily about one individual. And that is what made Gateway one of the best sf novels.
-- part contents for card part 4
----- text -----
That file does not exist
Or is not in the current folder
-- part contents for card part 25
----- text -----
-- part contents for card part 26
----- text -----
-- part contents for card part 27
----- text -----
-- part contents for card part 29
----- text -----
-- part contents for background part 53
----- text -----
1
-- part contents for background part 54
----- text -----
Frederik
-- part contents for background part 55
----- text -----
Pohl
-- part contents for background part 56
----- text -----
Heechee Rendezvous
-- part contents for background part 57
----- text -----
Ballantine
-- part contents for background part 58
----- text -----
pb
-- part contents for background part 59
----- text -----
83
-- part contents for background part 60
----- text -----
320
-- part contents for background part 61
----- text -----
3.95
-- part contents for background part 62
----- text -----
4
-- part contents for background part 63
----- text -----
fic
-- part contents for background part 65
----- text -----
sf
-- part contents for background part 66
----- text -----
3/22/85
-- part contents for background part 67
----- text -----
Might round out the Heechee saga that started in Gateway. Read it on the plane to NYC. Pohl is, of course, one of the very best. Still, this novel did not move me like it should have, like Gateway did. It tells a larger story than Gateway -- that is, it is not primarily about one individual. And that is what made Gateway one of the best sf novels.
1027 Pomona, Albany, CA 94706 If you like it, please send $10. Thanx.
This will read any TAB DELIMITED file into a new stack, allow you to name fields to hold the data, and do some layout of the form. It will provide a relatively complete HyperCard database that includes next, previous, and home buttons -- the rest is up to you.
You will be asked first for the name of the new stack -- the usual Mac getfile stuff works here. Next it will want to know the name of the text file file. You must either type the full path name of the file, or it must be in the HyperCard folder to work. The script will then read the file, figure out how many fields are in it and ask for the name of each field. Each field name defaults to the data that is in that field in the first record of the file -- to help you remember what each field is, or if you have put the field names at the top, to make it easier.
LIMITATIONS: There are many: 1) As of now, it will only read tab delimited fields, though I am working on other formats (such as mailmerge, comma delimited, SYLK, etc.). 2) All the created fields are the same size on screen. This simplified the coding, and it shouldn't be too hard to go back and adjust them.
CHANGES: Aside from making it more flexible in types of files it can read, it could go faster by locking the screen, so every record doesn't have to get written. But I like to see what is going on. You can also customize this by placing the "import" button onto a background you like better -- it is self contained.
Clicking "cancel" in most dialogues will NOT stop the entire operation -- I haven't done all the error trapping yet. Typing command-period will stop it, though it will leave the file open. Type "close file" followed by the file name into the message box to close the file. I have worked with files of up to 250 records, and it does take some time (about 10 minutes to read 200 or so records into a stack).